package com.example.computer_exam_training_sys.service.impl;

import com.example.computer_exam_training_sys.entity.UserStudyPlansInfo;
import com.example.computer_exam_training_sys.mapper.UserStudyPlansMapper;
import com.example.computer_exam_training_sys.service.UserStudyPlansService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserStudyPlansServiceImpl implements UserStudyPlansService {

    @Autowired
    private UserStudyPlansMapper userStudyPlansMapper;

    @Override
    public List<UserStudyPlansInfo> findall() {
        return userStudyPlansMapper.findall();
    }

    @Override
    public List<UserStudyPlansInfo> finduserAll(Integer userId) {
        return userStudyPlansMapper.finduserAll(userId);
    }

    @Override
    public UserStudyPlansInfo findplanById(Integer planId) {
        return userStudyPlansMapper.findplanById(planId);
    }

    @Override
    public int updateplanProgress(Integer planId, Integer addProgress) {
        return userStudyPlansMapper.updateplanProgress(planId, addProgress);
    }

    @Override
    public int updateplanStatus(Integer planId, Integer status) {
        return userStudyPlansMapper.updateplanStatus(planId, status);
    }

    @Override
    public int deleteplanById(Integer planId) {
        return userStudyPlansMapper.deleteplanById(planId);
    }

    @Override
    public int insert(UserStudyPlansInfo userStudyPlansInfo) {
        return userStudyPlansMapper.insert(userStudyPlansInfo);
    }
}
